import request from "@/utils/request";
import type { AxiosPromise } from "axios";
import type { UserCoinLogVO, UserCoinLogQuery } from "@/api/coin/types";

/**
 * 查询用户硬币变动记录列表
 * @param query
 * @returns {*}
 */

export const listUserCoinLog = (
  query?: UserCoinLogQuery
): AxiosPromise<UserCoinLogVO[]> => {
  return request({
    url: "/business/userCoinLog/list",
    method: "get",
    params: query,
  });
};

/**
 * 查询用户硬币变动记录详细
 * @param id
 */
export const getUserCoinLog = (
  id: string | number
): AxiosPromise<UserCoinLogVO> => {
  return request({
    url: "/business/userCoinLog/" + id,
    method: "get",
  });
};
